package org.nmgyjt.springboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nmgyjt.springboot.beans.vo.CsBusinessUserListVo;
import org.nmgyjt.springboot.entity.admin.CsBusinessUser;
import org.nmgyjt.springboot.entity.admin.CsSystemAdmin;
import org.nmgyjt.springboot.mapper.CsBusinessUserMapper;
import org.nmgyjt.springboot.service.ICsBusinessUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class CsBusinessUserServiceImpl extends ServiceImpl<CsBusinessUserMapper, CsBusinessUser> implements ICsBusinessUserService {

    @Autowired
    private CsBusinessUserMapper csBusinessUserMapper;

    @Override
    public List<CsBusinessUser> findByPone(String phone) {
        LambdaQueryWrapper<CsBusinessUser> queryWrapper = new LambdaQueryWrapper<CsBusinessUser>()
                .eq(CsBusinessUser::getPhone, phone);
        List<CsBusinessUser> csBusinessUserList = this.list(queryWrapper);
        return csBusinessUserList;
    }

    @Override
    public List<CsBusinessUserListVo> userByBusiness(String authPhone) {
        return csBusinessUserMapper.userByBusiness(authPhone);
    }

}
